// part1:C09:ex9.19.cpp
// read string from input, store it to list.
#include <iostream>
#include <list>
using namespace std;

int main(void){
  list<string> sl;
  string word;
  while (cin >> word) {
    sl.push_back(word);
  }

  for (auto si = sl.cbegin(); si != sl.cend(); si++) {
    cout << *si << endl;
  }
  return 0;
}
